package hu.dynamicwebshop.entities;

import java.math.BigInteger;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Szecskó Zoltán <zoltan.szecsko@gmail.com>
 */
@Entity()
@Table(name = "shop_users")
public class ShopUser {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "shop_user_seq")
    @SequenceGenerator(name = "shop_user_seq", sequenceName = "shop_user_seq")
    @Column(name = "user_id", nullable = false)
    private int userId;
    @OneToOne
    @JoinColumn(name = "home_address_id", nullable = false)
    private Address homeAddress;
    @OneToOne
    @JoinColumn(name = "delivery_address_id", nullable = false)
    private Address deliveryAddress;
    @Column(name = "username", nullable = false, length = 30, unique = true)
    private String username;
    @Column(name = "full_name", nullable = false, length = 60)
    private String fullName;
    @Column(name = "email", nullable = false, length = 255, unique = true)
    private String email;
    @Column(name = "phone_number", nullable = false, precision = 17, scale = 0)
    private BigInteger phoneNumber;
    @Column(name = "password", nullable = false, length = 40)
    private String password;
    @Column(name = "registration_date", nullable = false)
    private Timestamp registationDate;
    @Column(name = "user_role", nullable = false)
    private int userRole;

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Address getHomeAddress() {
        return homeAddress;
    }

    public void setHomeAddress(Address homeAddress) {
        this.homeAddress = homeAddress;
    }

    public Address getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(Address deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public BigInteger getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(BigInteger phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getRegistationDate() {
        return registationDate;
    }

    public void setRegistationDate(Timestamp registationDate) {
        this.registationDate = registationDate;
    }

    public int getUserRole() {
        return userRole;
    }

    public void setUserRole(int userRole) {
        this.userRole = userRole;
    }
}
